//
//  BoundsViewController.m
//  ObjcGoNew
//
//  Created by 邢伟新 on 2021/5/14.
//

#import "BoundsViewController.h"
#import <Masonry/Masonry.h>
@interface BoundsViewController ()

@property(nonatomic,strong)UIView *viewa;
@property(nonatomic,strong)UIView *viewb;


@end

@implementation BoundsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title = @"A";
    self.view.backgroundColor = [UIColor whiteColor];

    [self _initviews];
    
    UIButton *barrierButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [barrierButton setTitle:@"修改bounds" forState:(UIControlStateNormal)];
    [barrierButton addTarget:self action:@selector(barrierAction) forControlEvents:(UIControlEventTouchUpInside)];
    barrierButton.backgroundColor =[UIColor purpleColor];
    barrierButton.tag = 1001;
    [self.view addSubview:barrierButton];
    [barrierButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.height.mas_equalTo(50);
        make.bottom.mas_equalTo(-150);
    }];
    
}

-(void)barrierAction{
    self.viewa.bounds = CGRectMake(100, 100, 100, 100);
    
}

-(void)_initviews{
    
    //
    self.viewa = [[UIView alloc]initWithFrame:CGRectMake(100, 100, 200, 200)];
    self.viewa.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:self.viewa];
    
    self.viewb = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 50, 50)];
    self.viewb.backgroundColor = [UIColor redColor];
    [self.viewa addSubview:self.viewb];
    
    
    
    
}


@end
